package pl.edu.agh.uddiProxy.query;

import pl.edu.agh.uddiProxy.dao.DAOHelper;
import pl.edu.agh.uddiProxy.dao.DynamicParameterDAO;
import pl.edu.agh.uddiProxy.types.TModel;

public class UpdateTModelQuery {
	private DynamicParameterDAO dynamicParameterDAO;
	private TModel model;
	
	public UpdateTModelQuery(TModel model) {
		this.model = model;
		dynamicParameterDAO = DAOHelper.getDynamicParameterDAO();
	}
	
	/** execute query
	 * @return TModel with updated values
	 */
	public TModel execute() {
		dynamicParameterDAO.update(model.getDynamicParameter());
		return model;
	}
}
